[IA64] Allocate frame table/mpt table at mfn=0
authorawilliam@xenbuild.aw <awilliam@xenbuild.aw>
Tue, 5 Dec 2006 20:42:37 +0000 (13:42 -0700)
committerawilliam@xenbuild.aw <awilliam@xenbuild.aw>
Tue, 5 Dec 2006 20:42:37 +0000 (13:42 -0700)
Allocate frame table/mpt table at mfn=0 even when memory isn't assigned at
mfn=0 as work around for transate_domain_pte().

transate_domain_pte() returns mfn=0 when the machine page isn't present
as a work around for memory mapped I/O where no device is assigned.
Xen might access page_info of mfn=0, so it must be guaranteed that it
exists. Otherwise xen panics with a tlb miss fault in xen's virtual
address area.

Once transate_domain_pte() is fixed correctly, this will be removed.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
xen/arch/ia64/xen/xenmem.c

index c837f0fb4b5bc54c757cfeb54d8a1fb65fe51e84..8329ecfd6b677da5eeabdfec062f535cfc59f8ae 100644 (file)
@@ -181,6 +181,23 @@ void init_virtual_frametable(void)
        printk("virtual machine to physical table: %p size: %lukB\n"
               "max_page: 0x%lx\n",
               mpt_table, ((table_size << PAGE_SHIFT) >> 10), max_page);
+
+       /*
+        * XXX work around for translate_domain_pte().
+        * It returns mfn=0 when the machine page isn't present.  This
+        * behavior is a work around for memory mapped I/O where no device
+        * is assigned.  Xen might access page_info of mfn=0, so it must
+        * be guaranteed that it exists.  Otherwise xen panics with tlb miss
+        * fault in xen's virtual address area.
+        *
+        * Once translate_domain_pte() is fixed correctly, this will
+        * be removed.
+        */
+       if (!mfn_valid(0)) {
+               printk("allocating frame table/mpt table at mfn 0.\n");
+               create_frametable_page_table(0, PAGE_SIZE, NULL);
+               create_mpttable_page_table(0, PAGE_SIZE, NULL);
+       }
 }
 
 int